Hello all.
Here is a screen saver written in JB.
It behaves like a screen saver - fills (almost - well, there is a window title)
whole screen with black, draws mesmerizing patterns and quits then key pressed
or mouse moved.
But you probably could do that without me as well ;))
Now, the question is how to explain to Windows that this program is a screen
saver and should be run when computer has nothing better to do?

Ok. I did some research - found this.
http://www.clearnight.com.au/cnsss.htm
How to make a Screen Saver
(Make a Screen Saver for Windows using Visual Basic 6.0 or later. )
We do not use VB, but reading was of value.
It happened that:
Screensaver is just EXE program renamed to SCR which understands keys:
  /s - show screensaver
  /c configure screensaver
  /a something to do with password (we'll just ignore that)
  and /p show small preview in Desktop properties
  (since there no way to do it in JB we ignore it as well)
Problem is that I do not know how we can make EXE,
rename it to SCR and still get command line key in JB.

So. I write a program in C (this is not native language for me...
so code may contain bugs. But at least it works for me).
Compiled it with Turbo C Explorer 2006 (free one) into exe.
Made it read in command line keys
and in case of /s run line written in INI file.
Actually you can run ANY program here - but we speak of JB.
So, my line was
"C:\Program Files\Just BASIC v1.01\jbrun101.exe" C:\wrk\JastBasic\scr\scr02.tkn
It seems that path to EXE should be in "" (probably because of space in path),
but path to TKN need not "" regardless of having spaces.

Now, for making Wndows think it's a screensaver we need to rename EXE to SCR
and put it were all other screen savers live - in Windows\system32.
(I do not know if you have permissions to write there. I have XP SP2 and have
all rights on my computer, so I can do that).

Ok.
File list:
install.bat		file that copies JBSaver.scr to Windows\system32
JBSaver.c		C source code. Feel free to use it as you wish - public domain
JBSaver.exe		compiled EXE. You can run it and look what it says, and test keys
JBSaver.scr		renamed EXE (same EXE)
readMe.txt		this file
scr02.bas		JB source. You can use it as a base for your saver if you wish!
scr02.tkn		tokenised JB program

Installing:
Unpack this archive to a folder (not temporary one - you'll need TKN after).
Run install.bat
Hope you have permission to write to Windows\System32.
Now, Right click on descktop, select Properties
go to Screen saver tab
select "Jbsaver" from the list.
Then you first time press "Preview" it will
create JBSaver.INI file with instructions, in same place where SCR is, and open it
with Notepad.
You should correct last line (first without #) - set correct path to JB runtime
and to TKN file you want to run (try included scr02.tkn. It's good! )
Do not forget to save INI file.
If you want to edit existing INI file (say, change TKN to run another program), press
"Configure" in Screen saver tab.

That's all.
Next press of "Preview" should run JB screensaver, and if computer will sit idle for
what-period-of-time you choose, it'll fire this program as normal screensaver.

Troubleshooting:
* Just in case it wil not work. *
Try to run it from command line as
JBSaver.scr /s
It will print "About to run command:"
and then the line it runs.
You can be able to run that line from command line or from Srart Menu /Run.
If it doesn't run from where it will not run from JBSaver.scr as well.
After you get that string right, go to "Configure" in Screen saver tab and fix it.

That's all.
Hope it would be of use to someone.
Don't forget - now YOU can make real screen savers!
	
	Regards, tsh73
	Aug 2007

changes:
	Aug 08 2007 - initial version
	Aug 10 2007 -
  		v. 1.01 - now added mutex to prevent multiple launches

